
<template>
  <div>
    <avue-crud
      ref="crud"
      style="width: 100%"
      :data="loadData"
      :option="tableOption"
      :table-loading="loading"
      v-if="householdType != -1"
    >
      <template slot="timeAndAddress" slot-scope="scope">
        <div
          v-if="
            scope.row.dateAndAddressDto
              ? scope.row.dateAndAddressDto.length
              : false
          "
        >
          <p v-for="(item, index) in scope.row.dateAndAddressDto" :key="index">
            <span v-if="item">
              {{ item.serviceDate }}
              {{ item.receiveAdress }}
            </span>
          </p>
        </div>
      </template>
    </avue-crud>

    <div v-else style="text-align: center; padding: 160px 0">
      <h2>请先根据家政购买商品服务，勾选家政类别</h2>
    </div>
  </div>
</template>

<script>
import { tableOption } from "./sleeping.config.js";
import { workorderinfoHouseQueryHousePerson } from "@/api/shop/workorder/housekeeping.js";
export default {
  data() {
    return {
      tableOption: tableOption,
      loading: false,
      loadData: [],
      householdType: -1,
    };
  },
  methods: {
    getList(item, householdType) {
      this.householdType = householdType;
      workorderinfoHouseQueryHousePerson(
        Object.assign({ subOrderId: item.subOrderId,shopId:item.shopId }, { isService: "00",householdType:this.householdType })
      ).then((val) => {
        let data = val.data.data;
        this.loadData = data;

        console.log(7878, val);
      });
    },
  },
};
</script>